// index.js
const target = Math.floor(Math.random() * 100) + 1;
document.getElementById('submit').addEventListener('click', () => {
    const guess = parseInt(document.getElementById('guess').value);
    const result = document.getElementById('result');
    if(guess === target) result.textContent = '恭喜你猜对了!';
    else result.textContent = guess > target ? '太大了!' : '太小了!';
});